package com.innovate.nms.view;

import java.awt.Color;

import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class StatusLabel extends JLabel {

	/**
	 * 
	 */
	private static final long serialVersionUID = -612262581826214154L;
	
	private ImageIcon ok = null;
	
	private ImageIcon fail = null;
	
	

	public StatusLabel() {
		super();
	}
	
	public StatusLabel(String text) {
		super(text);
	}

	public void setImage(ImageIcon ok, ImageIcon fail) {
		
		this.ok = ok;
		
		this.fail = fail;
		
		setStatus(true);
		
	}
	
	public void setStatus(boolean status) {
		this.setIcon(status ? ok : fail);
		this.setForeground(status ? Color.GREEN.darker() : Color.GRAY);
	}

	

}
